<?php

class WikiWidget extends AbstractRouteWidget implements IWebConfig
{
    public function loadWebConfig(SimpleXMLElement $elem)
    {
        /*$fileExts = (string)$elem->attributes()->fileExts;
        $fileMaxSize = (string)$elem->attributes()->fileMaxSize;
        $uploadDir = (string)$elem->attributes()->uploadDir;

        if ($fileExts) {
            self::$fileExts = $fileExts;
        }

        if ($fileMaxSize) {
            self::$fileMaxSize = $fileMaxSize;
        }
        
        if ($uploadDir) {
            self::$uploadDir = $uploadDir;
        }*/  
    }

    public function getUser()
    {
        return Authorization::getUser();
    }

	public function showTemplate()
	{
		$uid = intval($this->params['id']);
		
		$user = User::getById($uid);
		
		Smarty2::Singleton()->assign('profile', $user);
		Smarty2::Singleton()->display('profile/index.tpl');
	}

    public function display()
    {
        $this->view->assign('user', $this->getUser());

        return $this->render('templates/view.tpl');
    }
}